home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / colorize.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-27  |  3KB  |  122 lines

  1. /* Colorize.rexx V2.0 -- Colorize a clip.<Based on curently selected color> */
  2. /* By Bob Caron © 1995 NewTek Inc.                                          */
  3.  
  4. parse arg InClipName","OutClipName","StartField","EndField
  5.  
  6. Address "DigiPaint"
  7. options results
  8.  
  9.  
  10. screen=0
  11. if inclipname="" & outclipname="" then screen=1
  12. if screen=1 then do
  13.    startfield=1
  14.    endfield=1
  15.    outclipname="Test"
  16.    end
  17.  
  18. IFFBaseName=OutClipName
  19.  
  20. if ~show('l','rexxsupport.library') then do
  21.   if ~addlib('rexxsupport.library',0,-30,34) then do
  22.     exit
  23.   end
  24. end
  25.  
  26. /* Reset Paint */
  27. 'Pmcl'
  28. 'Pot0' 0
  29. 'Pot1' 0
  30. 'Poth' $8000
  31. 'Potv' $8000
  32. 'Spoh' $8000
  33. 'Spov'
  34. /* End Of Reset*/
  35.  
  36. PageWide=752
  37. PageHigh=480
  38. dots=0
  39. XWin = 100
  40. YWin = 40
  41. Clear = d2c(12)
  42. nv = ''
  43. cr = '0a'x
  44. call getfontsize
  45.  
  46. wid = width*48
  47. hei = theight+height*10
  48.  
  49. if screen=0 then do
  50.    if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/Colorize Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  51.        exit
  52.    end
  53. end
  54.  
  55. do Frame = StartField to (StartField+(EndField-StartField)/2)
  56.   if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  57.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  58.   call filter()                    /* Do The filter Thing...                 */
  59.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  60.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  61.   if screen=0 then call filter()   /* If this is a flyer clip do other field */
  62.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  63.   if screen=1 then 'Shco'          /* Render To Buffer (if this is screen processing)*/
  64.   end
  65. if screen=0 then 'Iclp'            /* Add an flyer icon to this clip */
  66. exit
  67.  
  68. filter:  /* Do a filter */
  69.  
  70. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  71. 'Pmco'          /* colorize Mode */
  72. 'Mane'          /* Set Edge transparency to 0% */
  73. 'Whsc'          /* Fill Whole Screen */
  74. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  75.  
  76. return
  77.  
  78.  
  79. OpenWindow:
  80. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  81.   pdots="...."
  82.   dots=dots+1
  83.   if dots>4 then dots=1
  84.   call writech('Window',Clear||nv||cr)
  85.   call writech('Window','Current Source Clip ['InClipName']'cr)
  86.   call writech('Window','  Current Dest Clip ['OutClipName']'cr)
  87.   call writech('Window',''cr)
  88.   call writech('Window','Current Frame: 'Frame/2''cr)
  89.   call writech('Window','    End Frame:'EndFrame/2''cr)
  90.   call writech('Window',''cr)
  91.   call writech('Window','Processing'right(pdots,dots)||cr)
  92.  
  93. return
  94.  
  95.  
  96. getfontsize:
  97.  
  98. if open('font','env:sys/font.prefs','R') then do
  99.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  100.    call close('font')
  101.    font = substr(font,index(font,'FONT')+4)
  102.    font = substr(font,index(font,'FONT')+4)
  103.    height = c2d(substr(font,29,2))
  104.    tfont = substr(font,index(font,'FONT')+4)
  105.    theight = c2d(substr(tfont,29,2))
  106.    font = substr(font,33)
  107.    font = left(font,index(font,d2c(0))-1-5)
  108.    if open('font','FONTS:'font'/'height,'R') then do
  109.       width = c2d(right(readch('font',116),2))
  110.       call close('font')
  111.   end
  112.   else if height=9 then width = 10
  113.                    else width = 8
  114. end
  115.   else do
  116.   theight = 8
  117.   height = 8
  118.   width = 8
  119. end
  120.  
  121. return
  122.